<?php
namespace Admin\Controller;
use Common\Controller\MyInitController;
class HomeworkConfController extends MyInitController {
    public function index($itemid = '',$type = '',$backurl = ''){
		//echo 'homework';
		
		$List = D("list");
		$list = $List->select();
		
		$this->assign("list",$list);
		
		$this->display();
    }
	public function setTime(){
		if(IS_AJAX){
			/*=========定义变量=======*/
            $timeid = I('post.timeid');          			
			$time	= I("post.time");
			if($time == '') $time = null;
			$switch	= array("","updatastart","updataend","resubmitend","responsestart","responseend");
			$List   = D("list");
			
			$tmp	=	split("_",$timeid);
			$id		=	$tmp[0];
			$column	=	$switch[$tmp[1]];
			
			$List->$column = $time;
			
			$result = $List->where("id = $id")->save();
			if($result) {				
				$this->ajaxReturn($tmp);  				
			}else{
				$this->error($List->getError());
			}
		}
		else $this->error('非法的请求方式'); 	
	}
	
	
	
}




?>